package com.example.passwordmanager.dialog;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.FragmentManager;

public abstract class BaseDialogFragment extends DialogFragment {


   protected View rootView;
    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        rootView = inflater.inflate(getViewLayoutId(), container, false);
        initView(rootView);
        return rootView;
    }

    protected abstract int getViewLayoutId();

    protected abstract void initView(View view);


    public void show(FragmentManager fragmentManager){
        show(fragmentManager,getClass().getSimpleName());
    }
}
